﻿using System;

namespace Wrox.ProCSharp.Delegates
{
    class Employee
    {
        public Employee(string name, decimal salary, int year)//有参构造函数
        {
            Name = name;
            Salary = salary;
            Year = year;
        }

        public string Name { get; }//属性
        public decimal Salary { get; }//属性

        public int Year { get; }
        public override string ToString() => $"{Name}, {Salary:C}, {Year}";//重写方法

        //方法
        public static bool CompareSalary(Employee e1, Employee e2) =>
          e1.Salary < e2.Salary;
    }
}